Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: optimize material group #765

Merged
merged 3 commits into from
Sep 3, 2024

Conversation

hexqi
Copy link
Collaborator

@hexqi hexqi commented Aug 27, 2024

English | 简体中文

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Built its own designer, fully self-validated

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Background and solution

物料分组相关优化

  • 组件物料分组显示中文,添加label字段
  • 调整新分组与TinyVue组件分组一致:布局与容器、基础元素、高级元素、表单、表格、导航、数据展示、ElementPlus
  • 删除与TinyVue组件重复的HTML组件及HTML分组:button、img、table、form,部分HTML移入基础元素
  • TinyRow与TinyCol合并为 栅格布局组件
  • 添加物料时支持合并snippets分组
  • 物料分组不区分 内置组件、HTML组件
  • 其他:部分代码优化、规范物料文件格式

之前分组截图

image
image

What is the current behavior?

新分组截图

image
image

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

  • New Features

    • Introduced new UI components including TinySearch and TinyDatePicker.
    • Enhanced internationalization support for component rendering based on user locale.
  • Improvements

    • Renamed and reorganized existing components for clearer categorization and better usability.
    • Streamlined component registration process, improving clarity and organization.
  • Bug Fixes

    • Improved handling of event schemas for built-in components.
  • Documentation

    • Updated documentation to reflect new component names and structures for easier developer reference.

@hexqi hexqi changed the base branch from develop to refactor/develop August 27, 2024 12:23
Copy link
Contributor

coderabbitai bot commented Aug 27, 2024

Walkthrough

The changes involve significant structural modifications to multiple JSON configuration files and JavaScript components. Key updates include renaming component groups and entities for clarity, transitioning from plural to singular forms in component definitions, and enhancing internationalization support in a Vue.js template. The restructuring aims to improve organization, usability, and adaptability across the component library, while new functions have been introduced to streamline the processing of materials and snippets.

Changes

Files Change Summary
designer-demo/public/mock/bundle.json Renamed component groups and entities, updated schema definitions, introduced new components.
packages/builtinComponent/src/meta/*.json Changed keys from plural to singular, indicating a focus on single components.
packages/builtinComponent/src/meta/index.js Simplified export structure for components, updated snippet group name and labels.
packages/canvas/render/src/builtin/builtin.json Reorganized component definitions, removed properties, introduced new groups, translated names.
packages/plugins/materials/src/composable/useMaterial.js Restructured functions for processing materials, added new functions for snippets and blocks.
packages/plugins/materials/src/meta/component/src/Main.vue Enhanced internationalization support, replaced hardcoded names with locale variable.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Component
    participant i18n

    User->>Component: Request component
    Component->>i18n: Fetch locale
    i18n-->>Component: Return localized name
    Component-->>User: Render component with localized name
Loading

🐰 In the forest, changes bloom,
A new design dispels the gloom.
With names that sing and flow like streams,
Our components dance in vibrant dreams.
Hooray for clarity, joy in sight,
A rabbit's cheer for code done right!
🌼


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added enhancement New feature or request refactor-main refactor/develop branch feature labels Aug 28, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5fa1b2b and a5602a8.

Files selected for processing (8)
  • designer-demo/public/mock/bundle.json (7 hunks)
  • packages/builtinComponent/src/meta/CanvasCol.json (1 hunks)
  • packages/builtinComponent/src/meta/CanvasRow.json (1 hunks)
  • packages/builtinComponent/src/meta/CanvasRowColContainer.json (2 hunks)
  • packages/builtinComponent/src/meta/index.js (1 hunks)
  • packages/canvas/render/src/builtin/builtin.json (5 hunks)
  • packages/plugins/materials/src/composable/useMaterial.js (3 hunks)
  • packages/plugins/materials/src/meta/component/src/Main.vue (5 hunks)
Additional comments not posted (52)
packages/builtinComponent/src/meta/index.js (2)

6-6: LGTM!

The components array has been simplified, improving readability and maintainability.

The code changes are approved.


9-13: LGTM!

The snippets array has been updated to reflect a new grouping and labeling system, enhancing clarity and organization.

The code changes are approved.

packages/builtinComponent/src/meta/CanvasRowColContainer.json (2)

2-2: LGTM!

The key "components" has been changed to "component", indicating a shift to representing a single component.

The code changes are approved.


61-61: LGTM!

The key "snippets" has been changed to "snippet", reinforcing the focus on a singular snippet.

The code changes are approved.

packages/builtinComponent/src/meta/CanvasRow.json (1)

2-2: LGTM!

The key "components" has been changed to "component", indicating a shift to representing a single component.

The code changes are approved.

packages/builtinComponent/src/meta/CanvasCol.json (1)

2-2: LGTM! But verify the impact of this change.

The change from components to component suggests a shift from representing multiple components to a single component. Ensure that all references to this key in the codebase are updated accordingly.

The code changes are approved.

Run the following script to verify the impact of this change:

Verification successful

Change from components to component is verified and isolated.

The search results did not show any direct references to CanvasCol using the key components. This indicates that the change is isolated and should not impact other parts of the codebase. Ensure that any logic relying on this key is updated accordingly.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to the key `components` in the codebase.

# Test: Search for the key `components`. Expect: No occurrences related to CanvasCol.
rg --type json -A 5 $'"components"'

Length of output: 22202

packages/plugins/materials/src/meta/component/src/Main.vue (5)

7-11: LGTM!

The template changes enhance internationalization support by using the locale variable.

The code changes are approved.


16-25: LGTM!

The template changes enhance internationalization support by using the locale variable.

The code changes are approved.


41-41: LGTM!

The locale variable is now injected from the i18n module.

The code changes are approved.


61-61: LGTM!

The locale variable is now injected from the i18n module.

The code changes are approved.


73-73: LGTM!

The locale variable is now used to enhance the search functionality to be locale-aware.

The code changes are approved.

packages/plugins/materials/src/composable/useMaterial.js (4)

251-270: LGTM!

The function addComponentSnippets efficiently manages the addition of snippets, allowing for the merging of children if the group already exists.

The code changes are approved.


277-285: LGTM!

The function addComponents enhances the modularity and clarity of the code, allowing for better management of components.

The code changes are approved.


Line range hint 291-311: LGTM!

The function addBlocks ensures that it only processes valid arrays of blocks and registers them.

The code changes are approved.


319-322: LGTM!

The function addMaterials effectively streamlines the overall process of adding materials.

The code changes are approved.

packages/canvas/render/src/builtin/builtin.json (9)

6-61: LGTM!

The changes to the "Box" component, including renaming to "盒子容器" and reorganization under the "layout" group, improve clarity and usability.

The code changes are approved.


62-134: LGTM!

The changes to the "Slot" component, including renaming to "插槽", improve clarity and usability.

The code changes are approved.


135-221: LGTM!

The changes to the "Collection" component, including renaming to "数据源容器", improve clarity and usability.

The code changes are approved.


222-292: LGTM!

The changes to the "Text" component, including renaming to "文本", improve clarity and usability.

The code changes are approved.


293-362: LGTM!

The changes to the "Icon" component, including renaming to "图标", improve clarity and usability.

The code changes are approved.


363-431: LGTM!

The changes to the "Img" component, including renaming to "图片", improve clarity and usability.

The code changes are approved.


Line range hint 436-454: LGTM!

The introduction of the "layout" group with the "盒子容器" component improves clarity and usability.

The code changes are approved.


Line range hint 455-504: LGTM!

The introduction of the "basic" group with the "文本", "图标", and "图片" components improves clarity and usability.

The code changes are approved.


505-535: LGTM!

The introduction of the "advanced" group with the "插槽" and "数据源容器" components improves clarity and usability.

The code changes are approved.

designer-demo/public/mock/bundle.json (28)

13099-13102: Ensure correct label translation.

The label "视频" is used for the component. Verify that the translation is accurate and consistent with other labels.

Run the following script to verify the label translation:

Verification successful

Label translation is consistent and accurate.

The label "视频" is used consistently across the codebase for video components, indicating that the translation is accurate and correctly applied. No further action is needed.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the label translation in the codebase.

# Test: Search for the label usage. Expect: Consistent translation across the codebase.
rg --type json -A 5 $'"zh_CN": "视频"'

Length of output: 3085


13013-13016: Ensure consistency in component grouping.

The new group "layout" has been introduced with a label in Chinese. Verify that this group is consistently used throughout the codebase.

Run the following script to verify the group usage:

Verification successful

Group "layout" is consistently used across the codebase.

The group "layout" with the label "布局与容器" is consistently used in multiple JSON files. No issues found with its usage.

  • Files with consistent group usage:
    • designer-demo/public/mock/bundle.json
    • packages/canvas/render/src/builtin/builtin.json
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the group usage in the codebase.

# Test: Search for the group usage. Expect: Only occurrences of the new group name.
rg --type json -A 5 $'"group": "layout"'

Length of output: 820


13183-13186: Ensure correct label translation.

The label "按钮组" is used for the component TinyButtons. Verify that the translation is accurate and consistent with other labels.

Run the following script to verify the label translation:

Verification successful

Translation is consistent and accurate.

The label "按钮组" is consistently used across the codebase for components related to button groups, such as "TinyButtonGroup" and "TinyButtons". The translation is accurate and aligns with the component descriptions. No issues found.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the label translation in the codebase.

# Test: Search for the label usage. Expect: Consistent translation across the codebase.
rg --type json -A 5 $'"zh_CN": "按钮组"'

Length of output: 3700


13020-13022: Verify the label translation.

The label "栅格布局" is used for the component. Ensure that the translation is accurate and consistent with other labels.

Run the following script to verify the label translation:


13175-13177: Ensure correct text property.

The text property "按钮文案" is used for TinyButton. Verify that the text property is correctly applied and consistent with other text properties.

Run the following script to verify the text property:

Verification successful

Text property is consistent across the codebase.

The text property "按钮文案" is consistently applied across multiple JSON files in the codebase. No inconsistencies were found.

  • designer-demo/public/mock/bundle.json
  • mockServer/src/assets/json/bundle.json
  • packages/engine-cli/template/designer/public/mock/bundle.json
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the text property in the codebase.

# Test: Search for the text usage. Expect: Consistent text property across the codebase.
rg --type json -A 5 $'"text": "按钮文案"'

Length of output: 2106


13169-13173: Ensure correct label translation.

The label "按钮" is used for the component TinyButton. Verify that the translation is accurate and consistent with other labels.

Run the following script to verify the label translation:

Verification successful

Translation Consistency Verified

The label "按钮" is consistently used across multiple components and files, including TinyButton and ElButton, indicating that the translation is accurate and consistently applied throughout the codebase. No inconsistencies were found.

  • Files checked include designer-demo/public/mock/bundle.json, packages/engine-cli/template/designer/public/mock/bundle.json, and others.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the label translation in the codebase.

# Test: Search for the label usage. Expect: Consistent translation across the codebase.
rg --type json -A 5 $'"zh_CN": "按钮"'

Length of output: 6899


13439-13443: Ensure correct label translation.

The label "输入框" is used for the component TinyInput. Verify that the translation is accurate and consistent with other labels.

Run the following script to verify the label translation:

Verification successful

Translation is consistent and correct.

The label "输入框" is consistently used across the codebase for input-related components, and the translation is accurate. No further action is needed.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the label translation in the codebase.

# Test: Search for the label usage. Expect: Consistent translation across the codebase.
rg --type json -A 5 $'"zh_CN": "输入框"'

Length of output: 9377


13259-13262: Ensure correct placeholder property.

The placeholder property "输入关键词" is used for TinySearch. Verify that the placeholder property is correctly applied and consistent with other placeholder properties.

Run the following script to verify the placeholder property:

Verification successful

Placeholder property is consistent across the codebase.

The placeholder "输入关键词" is consistently used in multiple JSON files, indicating it is correctly applied. No inconsistencies were found.

  • designer-demo/public/mock/bundle.json
  • mockServer/src/assets/json/bundle.json
  • mockServer/src/mock/get/app-center/v1/apps/schema/918.json
  • mockServer/src/assets/json/appinfo.json
  • packages/engine-cli/template/designer/public/mock/bundle.json
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the placeholder property in the codebase.

# Test: Search for the placeholder usage. Expect: Consistent placeholder property across the codebase.
rg --type json -A 5 $'"placeholder": "输入关键词"'

Length of output: 3305


13189-13193: Ensure correct component naming.

The component "TinyButton" is introduced. Verify that the component name is consistent with the new naming convention.

Run the following script to verify the component naming:

Verification successful

Component Naming Verified: "TinyButton" is Consistently Used Across the Codebase

The component name "TinyButton" is consistently used in various JSON files throughout the codebase. There are no discrepancies or variations in the naming, indicating adherence to the intended naming convention. No further action is required.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the component naming in the codebase.

# Test: Search for the component usage. Expect: Consistent naming across the codebase.
rg --type json -A 5 $'"componentName": "TinyButton"'

Length of output: 29314


13498-13502: Ensure correct label translation.

The label "数字输入框" is used for the component TinyNumeric. Verify that the translation is accurate and consistent with other labels.

Run the following script to verify the label translation:

Verification successful

Translation is consistent and accurate.

The label "数字输入框" for the component "TinyNumeric" is consistently used across the codebase, ensuring accurate translation and representation. No discrepancies were found.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the label translation in the codebase.

# Test: Search for the label usage. Expect: Consistent translation across the codebase.
rg --type json -A 5 $'"zh_CN": "数字输入框"'

Length of output: 2369


13253-13257: Ensure correct label translation.

The label "搜索框" is used for the component TinySearch. Verify that the translation is accurate and consistent with other labels.

Run the following script to verify the label translation:

Verification successful

Translation Verified: Consistent Label Usage

The translation of the label "搜索框" for the component "TinySearch" is accurate and consistently used across the codebase. No discrepancies were found.

  • Files checked include:
    • designer-demo/public/mock/bundle.json
    • packages/engine-cli/template/designer/public/mock/bundle.json
    • mockServer/src/assets/json/bundle.json
    • mockServer/src/assets/json/appinfo.json
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the label translation in the codebase.

# Test: Search for the label usage. Expect: Consistent translation across the codebase.
rg --type json -A 5 $'"zh_CN": "搜索框"'

Length of output: 4061


13469-13473: Ensure correct label translation.

The label "复选框" is used for the component TinyCheckbox. Verify that the translation is accurate and consistent with other labels.

Run the following script to verify the label translation:

Verification successful

Translation is consistent and accurate.

The label "复选框" for the "TinyCheckbox" component is consistently used across multiple files in the codebase, indicating both consistency and likely accuracy in translation. No issues found.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the label translation in the codebase.

# Test: Search for the label usage. Expect: Consistent translation across the codebase.
rg --type json -A 5 $'"zh_CN": "复选框"'

Length of output: 3662


13445-13448: Ensure correct placeholder property.

The placeholder property "请输入" is used for TinyInput. Verify that the placeholder property is correctly applied and consistent with other placeholder properties.

Run the following script to verify the placeholder property:

Verification successful

Placeholder property is consistent across the codebase.

The placeholder "请输入" is consistently used across multiple JSON files, indicating that it is correctly applied and consistent. No variations were found in the placeholder text.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the placeholder property in the codebase.

# Test: Search for the placeholder usage. Expect: Consistent placeholder property across the codebase.
rg --type json -A 5 $'"placeholder": "请输入"'

Length of output: 13561


13225-13228: Ensure correct label translation.

The label "互斥按钮组" is used for the component TinyButtonGroup. Verify that the translation is accurate and consistent with other labels.

Run the following script to verify the label translation:

Verification successful

Translation Consistency Verified

The label "互斥按钮组" is consistently used across multiple JSON files for the TinyButtonGroup component. However, verifying the accuracy of the translation requires domain expertise. Please ensure the translation is accurate if necessary.

  • Consistent usage found in:
    • packages/engine-cli/template/designer/public/mock/bundle.json
    • mockServer/src/assets/json/bundle.json
    • mockServer/src/assets/json/appinfo.json
    • designer-demo/public/mock/bundle.json
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the label translation in the codebase.

# Test: Search for the label usage. Expect: Consistent translation across the codebase.
rg --type json -A 5 $'"zh_CN": "互斥按钮组"'

Length of output: 1903


13036-13039: Ensure correct span property.

The span property "span: 3" is used for TinyCol components. Verify that the span property is correctly applied and consistent with other span properties.

Run the following script to verify the span property:

Verification successful

Span property is consistent across the codebase.

The "span" property with the value 3 is consistently applied to "TinyCol" components across multiple files in the codebase. No inconsistencies were found.

  • Files checked include:
    • designer-demo/public/mock/bundle.json
    • packages/engine-cli/template/designer/public/mock/bundle.json
    • mockServer/src/assets/json/bundle.json
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the span property in the codebase.

# Test: Search for the span usage. Expect: Consistent span property across the codebase.
rg --type json -A 5 $'"span": 3'

Length of output: 8963


13454-13458: Ensure correct label translation.

The label "单选" is used for the component TinyRadio. Verify that the translation is accurate and consistent with other labels.

Run the following script to verify the label translation:

Verification successful

Translation Verified: "单选" Label Consistency Across Codebase

The label "单选" for the TinyRadio component is consistently used across multiple JSON files in the codebase, indicating accurate and uniform translation. No inconsistencies were found.

  • Files where "单选" is used:
    • designer-demo/public/mock/bundle.json
    • mockServer/src/assets/json/bundle.json
    • mockServer/src/assets/json/appinfo.json
    • packages/engine-cli/template/designer/public/mock/bundle.json
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the label translation in the codebase.

# Test: Search for the label usage. Expect: Consistent translation across the codebase.
rg --type json -A 5 $'"zh_CN": "单选"'

Length of output: 4092


13460-13463: Ensure correct text property.

The text property "单选文本" is used for TinyRadio. Verify that the text property is correctly applied and consistent with other text properties.

Run the following script to verify the text property:

Verification successful

Text property "单选文本" is consistent across the codebase.

The text property "单选文本" is consistently used across multiple JSON files without any variations. This confirms that the text property is correctly applied.

  • Files with consistent text property:
    • designer-demo/public/mock/bundle.json
    • mockServer/src/assets/json/bundle.json
    • mockServer/src/assets/json/appinfo.json
    • packages/engine-cli/template/designer/public/mock/bundle.json
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the text property in the codebase.

# Test: Search for the text usage. Expect: Consistent text property across the codebase.
rg --type json -A 5 $'"text": "单选文本"'

Length of output: 1634


13024-13027: Ensure correct component naming.

The component "TinyLayout" is introduced. Verify that the component name is consistent with the new naming convention.

Run the following script to verify the component naming:

Verification successful

Component Naming Verified: "TinyLayout" is Consistent Across the Codebase

The component name "TinyLayout" is consistently used in both the JSON configuration and the Vue file, indicating adherence to the naming convention. No inconsistencies were found.

  • Usage in designer-demo/public/mock/bundle.json
  • Usage in packages/plugins/robot/src/Main.vue
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the component naming in the codebase.

# Test: Search for the component usage. Expect: Consistent naming across the codebase.
rg --type json -A 5 $'"componentName": "TinyLayout"'

Length of output: 486


Script:

#!/bin/bash
# Description: Verify the component naming in the codebase across different file types.

# Search for the component name "TinyLayout" in JavaScript and TypeScript files.
rg --type js --type ts -A 5 'TinyLayout'

Length of output: 380


13489-13492: Ensure correct placeholder property.

The placeholder property "请输入" is used for TinyDatePicker. Verify that the placeholder property is correctly applied and consistent with other placeholder properties.

Run the following script to verify the placeholder property:

Verification successful

Placeholder property is consistent across the codebase.

The placeholder property "请输入" is consistently used in various JSON files, including designer-demo/public/mock/bundle.json. There are no inconsistencies or incorrect applications of this placeholder property.

  • Instances found in multiple files such as mockServer/src/assets/json/bundle.json, packages/engine-cli/template/designer/public/mock/bundle.json, and others.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the placeholder property in the codebase.

# Test: Search for the placeholder usage. Expect: Consistent placeholder property across the codebase.
rg --type json -A 5 $'"placeholder": "请输入"'

Length of output: 13561


13606-13609: Ensure correct label translation.

The label "走马灯" is used for the component TinyCarousel. Verify that the translation is accurate and consistent with other labels.

Run the following script to verify the label translation:

Verification successful

Translation Consistency Verified

The translation "走马灯" for the component "TinyCarousel" is consistently used across the codebase. The occurrences in various JSON files confirm its uniform application. No discrepancies were found.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the label translation in the codebase.

# Test: Search for the label usage. Expect: Consistent translation across the codebase.
rg --type json -A 5 $'"zh_CN": "走马灯"'

Length of output: 4256


13504-13508: Ensure correct placeholder property.

The placeholder property "请输入" is used for TinyNumeric. Verify that the placeholder property is correctly applied and consistent with other placeholder properties.

Run the following script to verify the placeholder property:

Verification successful

Placeholder Property Verified

The placeholder property "请输入" is consistently used across the codebase in various JSON files, indicating correct and uniform application. No inconsistencies were found.

  • Files verified include:
    • designer-demo/public/mock/bundle.json
    • packages/engine-cli/template/designer/public/mock/bundle.json
    • mockServer/src/assets/json/bundle.json
    • mockServer/src/assets/json/appinfo.json
    • mockServer/src/mock/get/app-center/v1/apps/schema/918.json
    • packages/canvas/test/group.json
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the placeholder property in the codebase.

# Test: Search for the placeholder usage. Expect: Consistent placeholder property across the codebase.
rg --type json -A 5 $'"placeholder": "请输入"'

Length of output: 13561


13581-13585: Ensure correct label translation.

The label "分页" is used for the component TinyPager. Verify that the translation is accurate and consistent with other labels.

Run the following script to verify the label translation:

Verification successful

Translation Consistency Verified

The translation "分页" for the component "TinyPager" is consistently used across multiple files in the codebase. However, verifying the accuracy of this translation in terms of language and context requires external validation.

  • Consistent usage found in:
    • designer-demo/public/mock/bundle.json
    • packages/engine-cli/template/designer/public/mock/bundle.json
    • packages/settings/design/src/schemas/pager.json
    • mockServer/src/assets/json/bundle.json
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the label translation in the codebase.

# Test: Search for the label usage. Expect: Consistent translation across the codebase.
rg --type json -A 5 $'"zh_CN": "分页"'

Length of output: 4553


13483-13487: Ensure correct label translation.

The label "日期选择" is used for the component TinyDatePicker. Verify that the translation is accurate and consistent with other labels.

Run the following script to verify the label translation:

Verification successful

Translation is consistent and accurate.

The label "日期选择" is consistently used across the codebase for the "TinyDatePicker" component, and it accurately translates to "Date Picker" in Chinese. No discrepancies found.

  • Files with consistent usage:
    • designer-demo/public/mock/bundle.json
    • mockServer/src/assets/json/appinfo.json
    • packages/engine-cli/template/designer/public/mock/bundle.json
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the label translation in the codebase.

# Test: Search for the label usage. Expect: Consistent translation across the codebase.
rg --type json -A 5 $'"zh_CN": "日期选择"'

Length of output: 2377


13231-13233: Ensure correct data property.

The data property is used for TinyButtonGroup. Verify that the data property is correctly applied and consistent with other data properties.

Run the following script to verify the data property:


13612-13615: Ensure correct height property.

The height property "180px" is used for TinyCarousel. Verify that the height property is correctly applied and consistent with other height properties.

Run the following script to verify the height property:

Verification successful

Height property is consistently applied.

The height property for the TinyCarousel component is consistently set to "180px" across the codebase, with no discrepancies found. This confirms that the height property is correctly applied and consistent.

  • Files checked include:
    • designer-demo/public/mock/bundle.json
    • packages/engine-cli/template/designer/public/mock/bundle.json
    • mockServer/src/assets/json/bundle.json
    • mockServer/src/assets/json/appinfo.json
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the height property in the codebase.

# Test: Search for the height usage. Expect: Consistent height property across the codebase.
rg --type json -A 5 $'"height": "180px"'

Length of output: 1933


Script:

#!/bin/bash
# Description: Search for any height properties used with TinyCarousel or related components.

# Test: Search for height properties in JSON files related to TinyCarousel.
rg --type json -A 5 '"componentName": "TinyCarousel"' | rg '"height":'

Length of output: 400


13475-13477: Ensure correct text property.

The text property "复选框文案" is used for TinyCheckbox. Verify that the text property is correctly applied and consistent with other text properties.

Run the following script to verify the text property:

Verification successful

Text property is consistent across the codebase.

The text property "复选框文案" is consistently applied in the following files:

  • designer-demo/public/mock/bundle.json
  • mockServer/src/assets/json/bundle.json
  • packages/engine-cli/template/designer/public/mock/bundle.json

No inconsistencies were found.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the text property in the codebase.

# Test: Search for the text usage. Expect: Consistent text property across the codebase.
rg --type json -A 5 $'"text": "复选框文案"'

Length of output: 1210


13030-13032: Verify the style property.

The style property "padding: 10px;" is used. Ensure that the style is correctly applied and consistent with other styles.

Run the following script to verify the style property:


13587-13592: Ensure correct layout property.

The layout property "total, sizes, prev, pager, next" is used for TinyPager. Verify that the layout property is correctly applied and consistent with other layout properties.

Run the following script to verify the layout property:

Verification successful

Layout property is consistent across the codebase.

The layout property "total, sizes, prev, pager, next" is consistently used across multiple JSON files, ensuring uniformity in its application. No inconsistencies were found.

  • designer-demo/public/mock/bundle.json
  • mockServer/src/assets/json/bundle.json
  • mockServer/src/assets/json/appinfo.json
  • packages/engine-cli/template/designer/public/mock/bundle.json
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the layout property in the codebase.

# Test: Search for the layout usage. Expect: Consistent layout property across the codebase.
rg --type json -A 5 $'"layout": "total, sizes, prev, pager, next"'

Length of output: 1966

@chilingling chilingling merged commit 1ed870c into opentiny:refactor/develop Sep 3, 2024
2 checks passed
yy-wow pushed a commit to yy-wow/tiny-engine that referenced this pull request Oct 10, 2024
物料分组相关优化
组件物料分组显示中文,添加label字段
调整新分组与TinyVue组件分组一致:布局与容器、基础元素、高级元素、表单、表格、导航、数据展示、ElementPlus
删除与TinyVue组件重复的HTML组件及HTML分组:button、img、table、form,部分HTML移入基础元素
TinyRow与TinyCol合并为 栅格布局组件
添加物料时支持合并snippets分组
物料分组不区分 内置组件、HTML组件
其他:部分代码优化、规范物料文件格式
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor-main refactor/develop branch feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants